//
//  LoadingView.swift
//  Yun
//
//  Created by 新宝 on 2017/9/27.
//  Copyright © 2017年 新宝. All rights reserved.
//

import UIKit

class LoadingView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    lazy var loading:UIView={
        let loading=UIView()
        loading.frame=CGRect(x:0,y:0,width:150,height:80)
        loading.center=CGPoint(x:screenWidth/2,y:60)
        loading.layer.masksToBounds=true
        loading.layer.cornerRadius=5
        loading.backgroundColor=UIColor(red:112/255.0,green:112/255.0,blue:112/255.0,alpha:1.0)
        return loading
    }()
    
    lazy var titleLabe:UILabel={
      let titleLabel=UILabel()
        titleLabel.frame=CGRect(x:0,y:20,width:150,height:40)
        titleLabel.font=UIFont.systemFont(ofSize: 18)
        titleLabel.text="数据加载中......"
        titleLabel.textAlignment = .center
        titleLabel.textColor=UIColor.white
        return titleLabel
    }()
    
    override var frame: CGRect{
        didSet{
            let newFrame=CGRect(x:0,y:0,width:screenWidth,height:screenHeight)
            super.frame=newFrame
        }

    }
    
    func setupUI(){
        self.backgroundColor=UIColor.white
        self.addSubview(loading)
        loading.addSubview(titleLabe)
        
}
    
   
}
